﻿using System;
using System.Collections.Generic;

namespace AgFractal.Fractals
{
    public abstract class AbstractFractal : AbstractElement, IFractal
    {
        public AbstractFractal()
        {
            parameter = new List<FractalParameter>();
        }

        #region IFractal Members

        public Func<double, double, short, short> Function
        {
            get { return Calculate; }
        }

        protected List<FractalParameter> parameter;
        public IEnumerable<FractalParameter> Parameter
        {
            get { return parameter; }
        }

        public double R1 { get; protected set; }
        public double I1 { get; protected set; }
        public double R2 { get; protected set; }
        public double I2 { get; protected set; }

        #endregion

        protected abstract short Calculate(double r, double i, short MaxIteration);
    }
}